<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新增用户</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
        }
        .container {
            margin-top: 50px;
        }
    </style>
</head>
<body>
<div class="container">
    <h2 class="text-center mb-4">新增用户</h2>
    <div class="card shadow">
        <div class="card-body">
            <form method="POST" action="{% url 'add_user' %}">
                {% csrf_token %}
                <div class="mb-3">
                    <label for="username" class="form-label">用户名</label>
                    <input type="text" id="username" name="username" class="form-control" placeholder="请输入用户名" required>
                </div>
                <div class="mb-3">
                    <label for="email" class="form-label">邮箱</label>
                    <input type="email" id="email" name="email" class="form-control" placeholder="请输入邮箱" required>
                </div>
                <div class="mb-3">
                    <label for="password" class="form-label">密码</label>
                    <input type="password" id="password" name="password" class="form-control" placeholder="请输入密码" required>
                </div>
                <div class="mb-3">
                    <label for="role" class="form-label">角色</label>
                    <select id="role" name="role" class="form-control" required>
                        <option value="admin">管理员 (Admin)</option>
                        <option value="user" selected>普通用户 (User)</option>
                        <option value="auditor">审计员 (Auditor)</option>
                    </select>
                </div>
                <div class="d-flex justify-content-between">
                    <button type="submit" class="btn btn-success">新增</button>
                    <a href="{% url 'user_management' %}" class="btn btn-secondary">取消</a>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
